/***********************************************************************
    filename:   DaterMainCalendarManagerWindow.h
    created:    10/4/2012
    author:     4Ys

    purpose:    Defines class for MainCalendarManagerWindow objects in UI
*************************************************************************/
#ifndef _DaterMainCalendarManagerWindow_h_
#define _DaterMainCalendarManagerWindow_h_

#include "DaterMainWindow.h"
#include "DaterButton.h"
#include "DaterMainCalendarDayWindow.h"
#include "DaterMainCalendarMonthWindow.h"
#include "DaterMainCalendarWindow.h"

class MainCalendarManagerWindow : public MainWindow
{
	/*!
	\brief
		The Main Calendar Manager Window.
	*/
public:
		/* !
		\brief
			Construct the sample of class MainCalendarManagerWindow.

		\param id_name
			- a string to represent the prefix of the window.
			
		\param parent
			- point to parent window.
			
		\param child
			- point to child window.
		*/
	MainCalendarManagerWindow(const CEGUI::String& id_name, CEGUI::Window* parent = 0, CEGUI::Window* child = 0);
		
		/* !
			Destructor of class MainCalendarManagerWindow.
		*/
	~MainCalendarManagerWindow();
	
		/* !
		\brief
			a virtual function generated from class MainWindow to show window.
		*/
	virtual void showWindow();

		/* !
		\brief
			Link the process when connected.
			
		\param args
			- the processing program.
		*/
	virtual void hideWindow();

	bool setToDayWindow(const CEGUI::EventArgs &args);

	bool setToMonthWindow(const CEGUI::EventArgs &args);

	bool setToAgendaWindow(const CEGUI::EventArgs &args);

	MainCalendarWindow* getCurrentCalendarWindow();

private:

		//! Member to subscribe handler to each 'slot' in the layout.
	CEGUI::Window* _child;
	
		/* !
		\brief
			Subscribe handler to each 'slot' in the layout.
		*/
	void subscribeEvents();

	bool backToIconWindow(const CEGUI::EventArgs &args);

	bool setToNextCalendarWindow(const CEGUI::EventArgs &args);

	bool setToPreCalendarWindow(const CEGUI::EventArgs & args);

	bool handle_releaseAnimationInstance(const CEGUI::EventArgs& args);

	bool handle_addEvent(const CEGUI::EventArgs& args);

	MainCalendarWindow* _currentCalendarWindow;

	std::map<std::string, Button*> _buttons;
};

#endif